package cn.jiyun.service.impl;

import cn.jiyun.mapper.ConstactorMapper;
import cn.jiyun.mapper.DeveloperMapper;
import cn.jiyun.mapper.DeveloperMapper;
import cn.jiyun.pojo.Constactor;
import cn.jiyun.pojo.Developer;
import cn.jiyun.pojo.Developer;
import cn.jiyun.pojo.Project;
import cn.jiyun.result.QueryPageBean;
import cn.jiyun.service.DeveloperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;
import java.util.Map;


@Service
public class DeveloperServiceimpl implements DeveloperService {
    @Autowired
    private DeveloperMapper developerMapper;

    @Autowired
    private ConstactorMapper constactorMapper;


    @Override
    public List<Map> findPage(QueryPageBean queryPageBean) {
        List<Map> list=developerMapper.findPage((queryPageBean.getCurrentPage()-1)*queryPageBean.getPageSize(),queryPageBean.getPageSize(),queryPageBean.getQueryString());
        return list;
    }


    @Override
    public void delete(String did) {
        developerMapper.delete(did);
    }

    @Override
    public List<Developer> findById(String pid) {
        return developerMapper.findById(pid);
    }

    @Override
    public int edit(Developer developer) {
        return developerMapper.edit(developer);
    }

    @Override
    public List<Developer> init() {
        return developerMapper.init();
    }

    @Override
    public List<Constactor> init2() {
        return constactorMapper.init2();
    }


    @Override
    public long jilu() {
        return developerMapper.jilu();
    }

    @Transactional
    @Override
    public void add(Developer developer) {
        developerMapper.add(developer);
    }

}
